#include <stdio.h>
#include <stdlib.h>

float max(float arr[]);
float min(float arr[]);

float dist(float arr[])
{

	return max(arr)-min(arr);

}

float max(float arr[])
{
	int i =0;
	float num = *arr;
	for(i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
	{
		if(num < arr[i])
		{
			num = arr[i];
		}
	}
	return num;

}

float min(float arr[])
{
	int i = 0;
	float num = *arr;
	for(i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
	{
		if(num > arr[i])
		{
			num = arr[i];
		}	
	}
	return num;

}

int main(void)
{

	float arr[] = {1.0,23,4,5.8,21.1,233.3,145.2,0};
//	printf("max - min = %f\n",dist(arr));
	float num = max(arr);
	printf("max:%f\n",num);

/*	printf("%d\n",sizeof(arr));
	printf("%d\n",sizeof(*arr));
*/	
	int j;
	float num2 = arr[0];
	for (j = 0;j<sizeof(arr)/sizeof(*arr);j++)
	{
		if (num2 < arr[j])
		{
			num2 = arr[j];
		}
	}
	printf("%f\n",num2);
	return 0;
}
